<?php
if(!defined('IN_XLR')) {
	exit('Access Denied');
}

//上传照片
function api_test($apiReq){
	global $_SGLOBAL, $_CONFIG;
	
	//$contact_list = array();
	$page_no = 1;
	if(isset($apiReq['page_no'])){
		$page_no = $apiReq['page_no'];
	}
	$pagesize = 10 ;
  	$rs_number = ($page_no - 1) * $pagesize ;

 	$sql = "select a.*,a.id as invite_id,b.nickname,b.thumb,b.height,b.sex from invite a,member b where a.member_id=b.id order by a.id desc limit $rs_number,$pagesize";
	$inviteList = get_db()->get_results($sql);

	// $query = master_db()->query($sql);
	// $inviteList = array();
	// while($invite = master_db()->fetch_array($query)){
	// 	array_push($inviteList, $invite);
	// }

	//$inviteList = $this->dbmain->get_results($sql);
	$count = count($inviteList);
  
	//输出
	$apiOut["returncode"] = "0";
 	$apiOut["apiReq"] = $apiReq;
 	$apiOut["invite_list"] = $inviteList;
 	$apiOut["count"] = $count;
 	$apiOut["page_no"] = $page_no;
 	$apiOut["stype"] = 'all';

	return $apiOut;
}
